package com.bird.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

/**
 * @data 2025/9/15 16:51
 * @author: bird
 * @description: 扫描mvc管理的bean
 *
 *
 *
 *
 */
@Configuration
@ComponentScan(value = "com.bird.controller")
@EnableWebMvc//这个是核心 开启和导入 DelegatingWebMvcConfiguration
public class MvcConfig {
    @Bean
    public InternalResourceViewResolver viewResolver() {
        InternalResourceViewResolver internalResourceViewResolver = new InternalResourceViewResolver();
        internalResourceViewResolver.setPrefix("/WEB-INF/jsp/");
        internalResourceViewResolver.setSuffix(".jsp");
        return internalResourceViewResolver;

    }
}
